/*
 * @Description:
 * @Author: py
 * @Date: 2024-07-30
 */
import { reactive } from 'vue'

export function useTable() {
    const gridOptions = reactive<any>({
        align: 'center',
        border: true,
        columnConfig: {
            resizable: true,
        },
        columns: [
            { type: 'seq', width: 50, title: '序号' },
            { field: 'activityName', minWidth: 150, title: '活动名称' },
            { slots: { default: 'voteRangeTime' }, title: '活动时间', width: 220 },
            { slots: { default: 'address' }, title: '活动地址', width: 200 },
            { slots: { default: 'createTime' }, title: '创建时间', width: 180 },
            { fixed: 'right', slots: { default: 'operate' }, title: '操作', width: 200 },
        ],
        data: [],
        height: 530,
        loading: false,
        showOverflow: false,
        toolbarConfig: {
            slots: {
                buttons: 'toolbar_buttons',
            },
        },
    })

    return { gridOptions }
}

export function useSignupTable() {
    const gridOptions = reactive<any>({
        align: 'center',
        border: true,
        columnConfig: {
            resizable: true,
        },
        columns: [
            { type: 'seq', width: 50, title: '序号' },
            { field: 'activityName', minWidth: 200, title: '活动名称' },
            { field: 'userName', minWidth: 150, title: '用户名称' },
            { field: 'communityName', minWidth: 150, title: '所在小区' },
            { field: 'phone', minWidth: 150, title: '联系电话' },
            { slots: { default: 'createTime' }, title: '申请时间', width: 180 },
            { fixed: 'right', slots: { default: 'operate' }, title: '操作', width: 200 },
        ],
        data: [],
        height: 530,
        loading: false,
        showOverflow: false,
        toolbarConfig: {
            slots: {
                buttons: 'toolbar_buttons',
            },
        },
    })

    return { gridOptions }
}
